package pattern2;

import java.util.Scanner;

/**
 * p17
 * 策略模式
 *
 * @author wdl
 */
public class StrategyPattern {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.println("输入商品的价格：");
        double money = input.nextDouble();
        System.out.println("请选择类型：1代表普通，2代表打8折，3代表满300-100");
        int type = input.nextInt();

        CashContext cashContext = new CashContext(type);
        System.out.println(cashContext.getResult(money));
    }
}